When you create an XML filter for Office, you need to design an XSLT stylesheet that can convert to and from the OpenDocument XML file format.
Office 用の XML フィルタを作成する場合は、OpenDocument XML ファイル形式との間で相互に変換可能なように XSLT スタイルシートをデザインする必要があります。
![]() | For more information about the OpenDocument XML format, go to http://xml.openoffice.org/.
OpenDocument XML 形式の詳細情報は、http://xml.openoffice.org/ を参照してください。 |
If you want, you can include a template with your filter to apply Office styles to an XML document that you import.
必要な場合、インポートする XML ドキュメントに Office スタイルを適用するために、フィルタに テンプレート を含めることができます。
You can also include the Document Type Definition (DTD) for the external XML format so you can validate the XML format, for example, when you test the filter.
たとえばフィルタをテストする場合などに XML の書式を検査できるように、外部 XML 形式用の 文書型定義 (Document Type Definition, DTD) を含めることもできます。
Create an XSLT transformation stylesheet that maps the elements of the external XML format to the elements of the OpenDocument XML file format and back again.
外部 XML 形式の要素と OpenDocument XML ファイル形式の要素とを相互にマップする、XSLT 変換 スタイルシート を作成します。
Create a template that assigns Office styles to elements in the external XML format when you import a file in this format into Office.
この形式から Office にファイルをインストールする場合、外部 XML 形式内の要素に Office スタイルを割り当てるためのテンプレートを作成します。
In Office Writer, create a text document, and choose .
Office Writer でテキストドキュメントを作成して、 を選択します。
Click New.
新規作成 をクリックします。
In the XML Filter dialog, click the General tab, and define the properties of the filter.
XML フィルタ ダイアログで、全般 タブをクリックしてから、フィルタのプロパティーを指定します。
In the Filter Name box, enter a name for the XML filter.
フィルタ名 ボックスに XML フィルタの名前を入力します。
This name is displayed in the XML Filter Settings dialog.
この名前は、XML フィルタの設定 ダイアログに表示されます。
In the Application box, select the Office application that the filter is for.
アプリケーション ボックスで、フィルタを使用する Office アプリケーションを選択します。
In the Name of File Type box, enter the file type that the filter is for.
ファイルの種類 ボックスに、そのフィルタを使用するファイルの種類を入力します。
This name is displayed in the list of file types in the Open, Export, and Save As dialogs.
この名前は、開く、エクスポート、および 名前を付けて保存 の各ダイアログで「ファイルの種類」リストに表示されます。
In the File extension box, enter the extension for the exported file.
ファイル拡張子 ボックスに、エクスポートするファイルの拡張子を入力します。
![]() | To differentiate the file from other XML files, enter an extension other than *.xml.
ファイル形式を XML ファイルと区別する場合、*.xml 以外の拡張子を入力します。 |
On the Transformation tab page, define the transformation properties for the filter.
変換 プロパティーページで、フィルタの変換プロパティーを指定します。
(Optional) In the DocType box, enter the document type identifier for the external file format.
(オプション) ドキュメントタイプ ボックスに、外部ファイル形式用のドキュメントタイプ識別子を入力します。
This identifier is used to detect the file type on import.
インポートするファイルの種類を判別するためにこの識別子が使用されます。
(Optional) In the DTD box, enter the path and file name of the DTD for the external file format.
(オプション) DTD ファイル ボックスに、外部ファイル形式用 DTD のパスおよびファイル名を入力します。
This DTD is used to validate the files on export.
エクスポートするファイルを検査するために、この DTD が使用されます。
In the XSLT for export box, enter the path and file name of the XSLT stylesheet that defines the transformation from OpenDocument format to the external format.
XSLT for export ボックスに、OpenDocument 形式から外部形式への変換方法を定義する XSLT スタイルシートのパスおよびファイル名を入力します。
In the XSLT for import box, enter the path and file name to the XSLT stylesheet that defines the transformation from the external format to OpenDocument format.
XSLT for import ボックスに、外部形式から OpenDocument 形式への変換方法を定義する XSLT スタイルシートのパスおよびファイル名を入力します。
(Optional) In the Template for import box, enter the path and name of the template that defines the Office styles that are used in the imported file.
(オプション) インポートするファイルに対して使用される Officeスタイルを指定するためのテンプレートファイルのパスとファイル名を インポート用テンプレート ボックスに入力します。
![]() | The files that are specified on the Transformation tab page are copied to the local Office users directory.
変換 プロパティーページで指定したファイルは、ローカルの Office ユーザーディレクトリにコピーされます。 |
Click OK.
OK をクリックします。
You can perform basic tests on a custom XML filter in Office.
Office 内で、カスタム XML フィルタの基本的なテストを行うことができます。
![]() | The document is not altered by these tests.
テストによってドキュメントが変更されることはありません。 |
Create or open a text document.
テキストドキュメントを作成するか、開くかします。
Choose .
を選択します。
In the list of filters, select the filter that you want to test, and click Test XSLTs.
このフィルタリストで、テスト対象のフィルタを選択してから、テキスト XSLT をクリックします。
To test an Export Filter, do one of the following in the Export area of the dialog:
エクスポート フィルタをテストする場合、ダイアログの エクスポート 領域に対して以下のいずれかを行います。
Click Browse, select the Office document that you want to test, and click Open.
検索 をクリックして、テストする Office ドキュメントを選択してから、開く をクリックします。
To test the current document, click Current Document.
現在のドキュメントをテストするには、現在のドキュメント をクリックします。
To test an Import Filter, click Browse in the Import area of the dialog, select a document, and click Open.
インポート フィルタをテストする場合は、ダイアログの インポート 領域にある 検索 をクリックし、ドキュメントを選択してから、開く をクリックします。
To validate the transformed file against the specified DTD, click Validate.
変換されたファイルを、指定した DTD に対して検査するには、検査 をクリックします。